#include<iostream>
#include<cstring>
using namespace std;
const int N = 200003, null = 0x4f4f4f4f;
int h[N];
int n, x;
char op;

int find(int x)
{
    int k = (x % N + N) % N;
    while (h[k] != null && h[k] != x)
    {
        k++;
        if (k == N)k = 0;
    }
    return k;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    memset(h, 0x4f, sizeof h);
    cin >> n;
    while (n--)
    {
        cin >> op >> x;
        int k = find(x);
        if (op == 'I')h[k] = x;
        else
        {
            if (h[k] == x)cout << "Yes" << endl;
            else cout << "No" << endl;
        }
    }
    return 0;
}